Sams Teach Yourself HTML5 Mobile Application Development in 24 Hours by Jennifer Kyrnin

Sams Teach Yourself HTML5 Mobile Application Development in 24 Hours by Jennifer Kyrnin

Author:Jennifer Kyrnin
Language: eng
Format: epub, pdf
ISBN: 9780132853309
Publisher: Sams Publishing


Date and Time Types

Dates and times are common fields on web forms, and HTML5 provides six specific input types to collect this information:

• <input type=datetime>

• <input type=datetime-local>

• <input type=date>

• <input type=month>

• <input type=week>

• <input type=time>

The date, month, week, and time types should be fairly self-explanatory. Dates are stored in the format:

YYYY-MM-DD

Months are the same, just without the day:

YYYY-MM

Weeks are sent as the year, followed by the number of the week:

YYYY-W##

Time is sent as:

HH:MM

The datetime and datetime-local types provide more specific dates, including both the date and the time. The only difference between the two is that the datetime includes time zone information and the datetime-local assumes the local time zone and so does not include that information. The formats for the data for these types are

• datetime (YYYY-MM-DDTHH:MMZ+00:00)

• datetime-local (YYYY-MM-DDTHH:MM)

The most frustrating aspect of these input types is that right now, although Safari 5 will create a picker that puts the dates in these formats, the only browser that provides a real date picker is Opera 9. Figure 13.6 shows what the Opera date picker looks like.

Figure 13.6. A date picker in Opera.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.